﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;

public partial class ChiTietTinTuc : System.Web.UI.Page
{
    QLTinTuc tt = new QLTinTuc();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack == false)
        {
            string matt = Session["matt"].ToString();
            FormView1.DataSource = tt.Load_CT_TinTuc(matt);
            FormView1.DataBind();

            lblNoiDung.Text = tt.Load_NoiDungTT(matt);
            string filename = Server.MapPath(lblNoiDung.Text);
            //if (!File.Exists(filename))
            //    return;
            FileStream fs = new FileStream(filename, FileMode.Open);
            BinaryFormatter formatter = new BinaryFormatter();
            string noidung = (string)formatter.Deserialize(fs);
            lblNoiDung.Text = noidung;
        }
    }
}
